<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {include file="/layout/scriptload"}
    <title>系统管理</title>
</head>
<body>
<div class="box">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">预约成功提醒</li>
            <li>预约成功通知</li>
            <li>预约成功通知</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="box-body">
                    <form role="form">
                        <input type="hidden" id="ids" value="{$data.id}">
                        <div class="form-group col-md-7" >
                            <label>所属AppId：<span style="color: #f71752">{$data.appid}</span></label>
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">内容描述</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_content1"></div>
                                    <input type="hidden" id="color_content" value="">
                                </div>
                            </label>
                            <input type="text" id="content" class="form-control" placeholder="内容描述...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">预约时间</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_apptime1"></div>
                                    <input type="hidden" id="color_apptime" value="">
                                </div>
                            </label>
                            <input type="text" id="apptime" class="form-control" placeholder="预约时间...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">预约场馆</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_place1"></div>
                                    <input type="hidden" id="color_place" value="">
                                </div>
                            </label>
                            <input type="text" id="palce" class="form-control" placeholder="预约场馆...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">预约对象</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_user1"></div>
                                    <input type="hidden" id="color_user" value="">
                                </div>
                            </label>
                            <input type="text" id="user" class="form-control" placeholder="预约对象...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">其他原因</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_reason1"></div>
                                    <input type="hidden" id="color_reason" value="">
                                </div>
                            </label>
                            <input type="text" id="reason" class="form-control" placeholder="预约对象...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">其他备注</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_remark1"></div>
                                    <input type="hidden" id="color_remark" value="">
                                </div>
                            </label>
                            <input type="text" id="remark" class="form-control" placeholder="预约对象...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>跳转链接</label>
                            <textarea class="form-control" id="t_url" cols="30" rows="3" placeholder="跳转链接..."></textarea>
                        </div>
                        <div class="form-group col-md-7">
                            <div id="btn_add" class="btn btn-info btn-flat pull-right">保存配置</div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="layui-tab-item">
                <div class="box-body">
                    <form role="form">
                        <div class="form-group col-md-7" >
                            <label>所属AppId：<span style="color: #f71752">{$data.appid}</span></label>
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">内容描述</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_content2"></div>
                                    <input type="hidden" id="color_content_2" value="">
                                </div>
                            </label>
                            <input type="text" id="content2" class="form-control" placeholder="内容描述...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">预约内容</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="appiont_content2"></div>
                                    <input type="hidden" id="appiont_content_2" value="">
                                </div>
                            </label>
                            <input type="text" id="appiontcontent2" class="form-control" placeholder="预约时间...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">开始时间</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_begin2"></div>
                                    <input type="hidden" id="color_begin_2" value="">
                                </div>
                            </label>
                            <input type="text" id="colorbegin2" class="form-control" placeholder="预约场馆...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">其他备注</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_remark2"></div>
                                    <input type="hidden" id="color_remark_2" value="">
                                </div>
                            </label>
                            <input type="text" id="remark2" class="form-control" placeholder="预约对象...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>跳转链接</label>
                            <textarea class="form-control" id="t_url2" cols="30" rows="3" placeholder="跳转链接..."></textarea>
                        </div>
                        <div class="form-group col-md-7">
                            <div id="btn_add2" class="btn btn-info btn-flat pull-right">保存配置</div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="layui-tab-item">
                <div class="box-body">
                    <form role="form">
                        <div class="form-group col-md-7" >
                            <label>所属AppId：<span style="color: #f71752">{$data.appid}</span></label>
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">内容描述</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_content3"></div>
                                    <input type="hidden" id="color_content_3" value="">
                                </div>
                            </label>
                            <input type="text" id="content3" class="form-control" placeholder="内容描述...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">预约内容</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="appiont_content3"></div>
                                    <input type="hidden" id="appiont_content_3" value="">
                                </div>
                            </label>
                            <input type="text" id="appiontcontent3" class="form-control" placeholder="预约时间...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">开始时间</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_begin3"></div>
                                    <input type="hidden" id="color_begin_3" value="">
                                </div>
                            </label>
                            <input type="text" id="colorbegin3" class="form-control" placeholder="预约场馆...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>
                                <div style="float: left;">其他备注</div>
                                <div style="font-weight: normal;float: left;margin-left:15px">颜色：
                                    <div id="color_remark3"></div>
                                    <input type="hidden" id="color_remark_3" value="">
                                </div>
                            </label>
                            <input type="text" id="remark3" class="form-control" placeholder="预约对象...">
                        </div>
                        <div class="form-group col-md-7" >
                            <label>跳转链接</label>
                            <textarea class="form-control" id="t_url3" cols="30" rows="3" placeholder="跳转链接..."></textarea>
                        </div>
                        <div class="form-group col-md-7">
                            <div id="btn_add3" class="btn btn-info btn-flat pull-right">保存配置</div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use('element', function(){
        var element = layui.element;
    });
    layui.use('colorpicker', function(){
        var colorpicker = layui.colorpicker;
        colorpicker.render({
            elem: '#color_content1'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_content').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_apptime1'  //绑定元素
            ,color:'#1890ff'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_apptime').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_place1'  //绑定元素
            ,color:'#1890ff'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_place').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_user1'  //绑定元素
            ,color:'#1890ff'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_user').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_reason1'  //绑定元素
            ,color:'#1890ff'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_reason').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_remark1'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_remark').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_content2'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_content_2').val(color);
            }
        });
        colorpicker.render({
            elem: '#appiont_content2'  //绑定元素
            ,color:'#1890ff'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#appiont_content_2').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_begin2'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_begin_2').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_remark2'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_remark_2').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_content3'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_content_3').val(color);
            }
        });
        colorpicker.render({
            elem: '#appiont_content3'  //绑定元素
            ,color:'#1890ff'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#appiont_content_3').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_begin3'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_begin_3').val(color);
            }
        });
        colorpicker.render({
            elem: '#color_remark3'  //绑定元素
            ,color:'#ff0044'
            ,size:'xs'
            ,format:'hex'
            ,done:function(color){
                $('#color_remark_3').val(color);
            }
        });
    });
    $(function(){
        $('#btn_add3').click(function(){
            var _id = $('#ids').val();
            var _content = $('#content3').val();
            var _color_content = $('#color_content_3').val();
            var _color_remark = $('#color_remark_3').val();
            var _remark = $('#remark3').val();
            var _appiontcontent2  =$('#appiontcontent3').val();
            var _appiont_content_2  =$('#appiont_content_3').val()
            var _begin = $('#colorbegin3').val();
            var _color_begin_2  =$('#color_begin_3').val();
            var _t_url = $('#t_url3').val();
            $.ajax({
                cache: false,
                url:"{:url('template/doSetTemplate')}",
                data:{id:_id,type:3,begin:_begin,color_begin_2:_color_begin_2,color_remark:_color_remark,remark:_remark,t_url:_t_url,content:_content,color_content:_color_content,appiontcontent2:_appiontcontent2,appiont_content_2:_appiont_content_2},
                type:'post',
                success:function(data){
                    if(data.code==0){
                        layerAlert('添加成功',function(){
                            parent.relist();
                            layerParentClose();
                        })
                    }else{
                        layerAlert('添加失败');
                    }
                },
                error:function () {
                    layerAlert('系统错误，请联系管理员');
                }
            })
        });
        $('#btn_add2').click(function(){
            var _id = $('#ids').val();
            var _content = $('#content2').val();
            var _color_content = $('#color_content_2').val();
            var _color_remark = $('#color_remark_2').val();
            var _remark = $('#remark2').val();
            var _appiontcontent2  =$('#appiontcontent2').val();
            var _appiont_content_2  =$('#appiont_content_2').val()
            var _begin = $('#colorbegin2').val();
            var _color_begin_2  =$('#color_begin_2').val();
            var _t_url = $('#t_url2').val();
            $.ajax({
                cache: false,
                url:"{:url('template/doSetTemplate')}",
                data:{id:_id,type:2,begin:_begin,color_begin_2:_color_begin_2,color_remark:_color_remark,remark:_remark,t_url:_t_url,content:_content,color_content:_color_content,appiontcontent2:_appiontcontent2,appiont_content_2:_appiont_content_2},
                type:'post',
                success:function(data){
                    if(data.code==0){
                        layerAlert('添加成功',function(){
                            layerParentClose();
                            parent.window.location.reload();
                        })
                    }else{
                        layerAlert('添加失败');
                    }
                },
                error:function () {
                    layerAlert('系统错误，请联系管理员');
                }
            })
        });
        $('#btn_add').click(function(){
            var _id = $('#ids').val();
            var _content = $('#content').val();
            var _color_content = $('#color_content').val();
            var _apptime = $('#apptime').val();
            var _color_apptime = $('#color_apptime').val();
            var _palce = $('#palce').val();
            var _color_place = $('#color_place').val();
            var _user = $('#user').val();
            var _color_user = $('#color_user').val();
            var _reason = $('#reason').val();
            var _color_reason = $('#color_reason').val();
            var _color_remark = $('#color_remark').val();
            var _remark = $('#remark').val();
            var _t_url = $('#t_url').val();
            $.ajax({
                cache: false,
                url:"{:url('template/doSetTemplate')}",
                data:{id:_id,type:1,reason:_reason,color_reason:_color_reason,color_remark:_color_remark,remark:_remark,t_url:_t_url,content:_content,color_content:_color_content,apptime:_apptime,color_apptime:_color_apptime,place:_palce,color_place:_color_place,user:_user,color_user:_color_user},
                type:'post',
                success:function(data){
                    if(data.code==0){
                        layerAlert('添加成功',function(){
                            layerParentClose();
                            parent.window.location.reload();
                        })
                    }else{
                        layerAlert('添加失败');
                    }
                },
                error:function () {
                    layerAlert('系统错误，请联系管理员');
                }
            })
        })
    })
</script>
</html>